/**
 * @file     findLengthOfLCIS.js
 * @brief    [674. 最长连续递增序列](https://leetcode.cn/problems/longest-continuous-increasing-subsequence/description/)
 * @author   Zhu
 * @date     2023-06-14 22:54
 */

/**
 * @param {number[]} nums
 * @return {number}
 */
var findLengthOfLCIS = function (nums) {
    let max = 0;
    let pre = -Infinity;
    let localMax = 0;
    for (const num of nums) {
        if (num > pre) {
            localMax++;
        } else {
            if (localMax > max) max = localMax;
            localMax = 1;
        }
        pre = num;
    }

    if (localMax > max) max = localMax;
    return max;
};
